package com.util;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

import com.sun.jmx.snmp.Timestamp;

public class test {
	public String getUniqueCode() throws InterruptedException {
        String str = "0123456789abcdefghijklmnopqrstuvwxyz";
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMM-ddHHmm-ss0ms");
    	String ly_time = sdf.format(new java.util.Date());
        StringBuilder builder = new StringBuilder();
        for (int i = 1; i <= 7; i++) {
        	if(i%7==0){
        		builder.append("-");
        	}else{
        		builder.append(str.charAt((int) (Math.random() * 36)));
        	}
        }
        builder.append(ly_time);
        return builder.toString().toUpperCase();
    }
	

	/**
	 * @param args
	 * @throws InterruptedException 
	 */
	public static void main(String[] args) throws InterruptedException {
		
//		test t = new test();
//		String s=t.createPassword(22);
//		System.out.println(s);
		
//		String emailAddr1="1111@qq.com;2222@qq.com;3333@qq.com;4444@qq.com";
//		String emailAddr2="1111@qq.com;2222@qq.com;5555@qq.com;6666@qq.com";
//		String emailAddr=emailAddr1+";"+emailAddr2;
//		String[] emailAddrArgs = emailAddr.split(";");
//		Map emailMap = new HashMap();
//		for(int i=0;i<emailAddrArgs.length;i++){
//			emailMap.put(emailAddrArgs[i], emailAddrArgs[i]);
//		}
//		Iterator ite=emailMap.keySet().iterator();
//		while(ite.hasNext()){
//			System.out.println(emailMap.get(ite.next()));
//		}


	}

}
